/*****************************************************************************/
/*                                                                           */
/*    Domino Operation System Driver Module                                  */
/*                                                                           */
/*    Copyright (C) 2005 Laszlo Arvai                                        */
/*                                                                           */
/*    ------------------------------------------------------------------     */
/*    drvTouchScreen.h - Resistive Touch Screen Driver                       */
/*****************************************************************************/

#ifndef __drvTouchScreen_h
#define __drvTouchScreen_h

#include "krnlTypes.h"

///////////////////////////////////////////////////////////////////////////////
// Constants
#define drvTOUCH_DRIVE_PORT PORTD
#define drvTOUCH_DRIVE_DDR DDRD
#define drvTOUCH_DRIVE_XR PD0
#define drvTOUCH_DRIVE_XL PD2
#define drvTOUCH_DRIVE_YT PD1
#define drvTOUCH_DRIVE_YB PD3

#define drvTOUCH_INPUT_MASK ~(_BV(MUX4)|_BV(MUX3)|_BV(MUX2)|_BV(MUX1)|_BV(MUX0))
#define drvTOUCH_INPUT_X 0
#define drvTOUCH_INPUT_Y 1

#define drvTOUCH_INPUT_AVERAGING 16

#define drvTOUCH_MIN_AD_X 65
#define drvTOUCH_MIN_AD_Y 97
#define drvTOUCH_MAX_AD_X 805
#define drvTOUCH_MAX_AD_Y 780

#define drvTOUCH_FOCUS_THRESHOLD 10
#define drvTOUCH_AD_VALUE_TRESHOLD 10

///////////////////////////////////////////////////////////////////////////////
// Function prototypes
void drvInitTouchScreen(void);

#endif
